
# def cleantext(text)
	# text.collect do |line|
		# line.chomp
		# end
# end

# def matchnumber(string)
	# match=/\((\d+)\)/.match(string)[1].to_s
# end




# def sortline(text)
	# line=cleantext(text)
	
	# # sortedline=line.sort do |one ,two|
		# # -(matchnumber(one)<=>matchnumber(two))
		# # end
	# puts line.sort {|one,two|-(matchnumber(one)<=>matchnumber(two))}	
	 
# end


# file=File.open("lines.txt").readlines
# sortline(file)


def rearrange(text)
	# match=/(\w+), (\w+) (\w+)/.match(text)||/(\w+), (\w+)/.match(text)
	match=/(\w+), (\w+)? (\w+)/.match(text)
	# # (match[3]==nil)?("#{match[2]} #{match[1]}","#{match[2]} #{match[3][0..0]}. #{match[1]}")
	# if match[3]==nil
		# return "#{match[2]} #{match[1]}"
	# else
		# return "#{match[2]} #{match[3][0..0]}. #{match[1]}"
	# end
	
end

if $0==__FILE__
	name ="Marick, Dawn Elaine"
	rearrange(name)
end